package com.warren.ioc;

import com.warren.beans.PropertyValue;
import com.warren.beans.PropertyValues;
import com.warren.beans.factory.ConfigurableListableBeanFactory;
import com.warren.beans.factory.config.BeanDefinition;
import com.warren.beans.factory.config.BeanFactoryPostProcessor;
import com.warren.error.BeansException;

/**
 * @author warren
 * @create 2021-08-20 13:33
 * @Description
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("company","改为:字节跳动"));
    }
}
